<a href="getpwd.asp?mode=1">忘记密码</a></span> </p>

来源:百度知道 编辑:UC知道 时间:2024/06/22 14:49:42
<a href="getpwd.asp?mode=1">忘记密码</a></span> </p> 这里的 getpwd.asp是拿回密码的页面 请问后面为什么mode=1 ?
getpwd.asp的代码:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp" -->

<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<%
mode=request.querystring("mode")
if mode=1 then
%>
<style type="text/css">
<!--
body {
background-color: #99CCFF;
}
-->
</style><br>
<form name="form1" method="post" action="getpwd.asp?mode=2">
<table width="100%" border="0" align="center" bgcolor="#CCFFFF">
<tr align="center">
<td height="30" bgcolor="#99CCFF"><span class="new12">想取回密码请输入你的用户名</span&g

thanks~~

mode是用来作为控制的参数吧,

用来判断这个的

mode=request.querystring("mode")
if mode=1 then

if mode=2 then

if mode=3 then

共存在这三种情况,但是你将默认值设为固定的mode=1,那么无论你怎么点忘记密码按钮,都会提示你 想取回密码请输入你的用户名

你应该在提交的时候针对 用户名 是否输入做几个判断

如果你仔细阅读一下getpwd.asp这个页面的代码,你就会发现,mode的值是在变化的,一开始根据mode=1,程序会给用户返回一个页面,用户在这个页面上填写“想取回密码请输入你的用户名”,当用户填写完,点击“提交”的时候,mode就变成了2,这个时候,程序就会去检索数据库,查看是否存在用户,如果存在则mode=3,来要求用户输入“问题的答案”。其实mode就相当于step或者是condition之类的一个标志,用来控制取回密码的业务流程的!

mode 来区分不同的提交,并显示不同的页面

为1时:想取回密码请输入你的用户名
为2时:显示问题并要求输入问题答案
为3时:显示您的密码已被设为默认密码:123456